﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.QcManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.QcManagement.QcSheetVMs
{
    public partial class QcSheetTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._QcSheet._WoId")]
        public ExcelPropety WoId_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.WoId);
        [Display(Name = "_Model._QcSheet._WoCode")]
        public ExcelPropety WoCode_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.WoCode);
        [Display(Name = "_Model._QcSheet._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.ProductId);
        [Display(Name = "_Model._QcSheet._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.ProductName);
        [Display(Name = "_Model._QcSheet._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.Sn);
        [Display(Name = "_Model._QcSheet._Template")]
        public ExcelPropety Template_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.TemplateId);
        [Display(Name = "_Model._QcSheet._QcOperator")]
        public ExcelPropety QcOperator_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.QcOperator);
        [Display(Name = "_Model._QcSheet._QcResult")]
        public ExcelPropety QcResult_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.QcResult);
        [Display(Name = "_Model._QcSheet._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.Remark);
        [Display(Name = "_Model._QcSheet._QcMode")]
        public ExcelPropety QcMode_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.QcMode);
        [Display(Name = "_Model._QcSheet._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.CreateTime, true);
        [Display(Name = "_Model._QcSheet._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.UpdateTime, true);
        [Display(Name = "_Model._QcSheet._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.CreateBy);
        [Display(Name = "_Model._QcSheet._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.UpdateBy);
        [Display(Name = "_Model._QcSheet._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.IsValid);
        [Display(Name = "_Model._QcSheet._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<QcSheet>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Template_Excel.DataType = ColumnDataType.ComboBox;
            Template_Excel.ListItems = DC.Set<QcTemplate>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class QcSheetImportVM : BaseImportVM<QcSheetTemplateVM, QcSheet>
    {
            //import

    }

}